{
  "properties" : { },
  "id" : "copy1731155506178d60016",
  "script" : null,
  "groupId" : "f9afd5b430b143c5850583dc7e07f4bb",
  "name" : "syjkhm.html",
  "createTime" : 1731318377479,
  "updateTime" : 1731157122746,
  "lock" : null,
  "createBy" : "管理员",
  "updateBy" : "管理员",
  "path" : "syjkhm.html",
  "method" : "GET",
  "parameters" : [ ],
  "options" : [ ],
  "requestBody" : "",
  "headers" : [ ],
  "paths" : [ ],
  "responseBody" : null,
  "description" : null,
  "requestBodyDefinition" : null,
  "responseBodyDefinition" : null
}
================================
import response;

var taskList = db.table('mq_task').where().eq("type", "m3u8_start").select();
var groupList = db.select("SELECT page_name FROM `mq_task` WHERE type = 'm3u8_start' and page_name like '邵阳市%' GROUP BY page_name, page_topic");

for (item in groupList) {
    item['list'] = [];
    for (taskItem in taskList) {
        if(item.pageName.equals(taskItem.pageName)){
            item['list'].add({
                "id": taskItem.id,
                "name": taskItem.name,
                "pageName": taskItem.pageName,
                "isStart": db.table("mq_bk_msg").where().eq("msg_id", taskItem.id).and().like('msg', 'frame=%').count() == 1,
                "isError": db.table("mq_bk_msg").where().eq("msg_id", taskItem.id+"_2").and().like('type', 'img').count() == 0,
            });
        }
    }
}

var params = {
    groupList: groupList
};
var url = '/page/content/syjkhm.html';

return response.ftl(params,url)